package com.koron.operation.classes.form.controller;


import com.koron.bean.base.Response;
import com.koron.common.core.config.ThreadLocalContext;
import com.koron.operation.classes.form.bean.po.ClassesFormShift;
import com.koron.operation.classes.form.service.ClassesFormShiftService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.koron.ebs.mybatis.ADOConnection;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * 月度排班班次(ClassesFormShift)表控制层
 *
 * @author jzp
 * @since 2023-05-18 10:19:15
 */
@Api(tags = "月度排班班次接口")
@RestController
@RequestMapping("classesFormShift")
public class ClassesFormShiftController {
    /**
     * 服务对象
     */
    @Autowired
    private ClassesFormShiftService classesFormShiftService;

    private String getCurrDs() {
        return ThreadLocalContext.get().getCurrDs();
    }

    /**
     * 通过主键查询单条数据
     *
     * @param id 主键
     * @return 单条数据
     */
    @ApiOperation(value = "根据id查询")
    @GetMapping
    public Response<ClassesFormShift> selectOne(@RequestParam String id) {
        return Response.ok(ADOConnection.runTask(getCurrDs(), classesFormShiftService, "getById", ClassesFormShift.class, id));
    }

}
